Ext.supreme = {
    autor: 'soldier.kam',
    contact: 'soldier.kam@gmail.com',
    downloadIconUrl: '/static/images/down.png',
    serviceUrlPrefix: new Object(),
    hostIsActiveIcon: '/static/images/star.png',
    hostIsNotActiveIcon: '/static/images/silver-star.png'
};

Ext.supreme.serviceUrlPrefix.t0 = 'ftp://';
Ext.supreme.serviceUrlPrefix.t1 = 'smb://';
Ext.supreme.fileSizeConverter = function(sizeInBytes, saturation){
    if (sizeInBytes == undefined){
        return '';
    }
    if(sizeInBytes < 1024)
        return parseInt(sizeInBytes) + ' B';
    var valueKilo = sizeInBytes / 1024;
    if(valueKilo < 1024)
        return parseInt(valueKilo) + ' KB';
    var valueMega = valueKilo / 1024
    if(valueMega < 1024 || saturation)
        return parseInt(valueMega) + ' MB';
    
    var valueGiga = valueMega / 1024
    if(valueGiga < 1024)
        return parseInt(valueGiga) + ' GB';
    var valueTera = valueGiga / 1024
    if(valueTera < 1024)
        return parseInt(valueTera) + ' TB';
    var valuePeta = valueTera / 1024
    if(valuePeta < 1024)
        return parseInt(valuePeta) + ' TB';
    return '';
}

Ext.supreme.showMsg = function(title, text){
    Ext.example.msg(title, text);
}

